package cn.lzx.lock.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * Created by lizhenxing on 2018/1/9.
 */
public interface UserJpaRepository extends JpaRepository<User, Long> {

    @Modifying
    @Query(value = "update user set password=?1 where id=?2", nativeQuery = true)
    int update(String password, Long userId);

    @Modifying
    @Query(value = "update user set password=?1 where identity=?2", nativeQuery = true)
    int update(String password, String identity);
}
